
{% load i18n plmapp_tags %}

<!-- Manage html display in the Content div which correspond to the "doc-cad" menu + "add new"-->
{% if obj|main_type == "document" and obj.files.count > 0 %}
    <button id="add_text" class="tb-btn tb-btn-large">{% trans "Add new files" %}</button>
{% endif %}
<div id="add_form_file">
    {% with add_file_form as form %}
        {% include "snippets/undo_form.html" %}
    {% endwith %}
    <noscript>
        <div style="display:table;" class="warning">
	    {% trans "You can only upload one file at a time." %}<br/>
	    {%trans "Use the Validate button to send your file." %}
        </div>
    </noscript>
    <form class="hidden" action="" target="hidden_frame" method="post" enctype="multipart/form-data">{% csrf_token %}</form>
    <div style="margin:1%;">
        <input type="button" class="tb-btn tb-btn-primary hidden" value="{% trans "Upload" %}" id="_up"/>
		<input type="button" class="tb-btn hidden" value="{% trans "Delete" %}" id="_delete" title="{%trans "Delete the files selected for upload" %}"/>
    </div>
    <div id="div_files"></div>
</div>
<script type="text/javascript" src="{{STATIC_URL}}js/file.js"></script>
<script type="text/javascript">
    {% with file_formset.forms as forms %}
        {% for form in forms %}
            files_linked.push("{{form.instance.filename}}");
        {% endfor %}
    {% endwith %}
    doc_type="{{object_type}}";
    trans["Select at least one file"]="{% trans 'Select at least one file' %}";
    trans["A STEP file is already linked to this document."]="{% trans 'A STEP file is already linked to this document.' %}";
    trans["A file named "]="{% trans 'A file named ' %}";
    trans["is already linked to this document."]="{% trans 'is already linked to this document.' %}";
    trans["You have already selected the file"]="{% trans 'You have already selected the file' %}";
    trans["for upload"]="{% trans 'for upload' %}";
    trans["remove the file from the queue"]="{% trans 'remove the file from the queue' %}";
    trans["Your upload(s) failed"]="{% trans 'Your upload(s) failed' %}";
    trans["Try again"]="{% trans 'Try again' %}";
    trans["maybe with less files. "]="{% trans 'maybe with less files. ' %}";
    trans["You are checking-in for "]="{% trans 'You are checking-in for ' %}";
    trans["You must add a file with this name."]="{% trans 'You must add a file with this name.' %}";
    trans["Show/Hide the upload form"]="{% trans 'Show/Hide the upload form' %}";
    trans["Check-in for file "]="{% trans 'Check-in for file ' %}";
    trans["You can only upload files, but you wont get progress of this upload"]="{% trans 'You can only upload files, but you wont get progress of this upload' %}";
    trans["Do not leave the current page until the upload ends"]="{% trans 'Do not leave the current page before the upload ends' %}";
    trans["waiting"]="{% trans 'waiting' %}";
    trans["Total"]="{% trans 'Total' %}"
</script>
<script type="text/javascript" src="{{STATIC_URL}}js/opera_upload.js"></script>


